$(function() {

	getUserInfo();

});

function getUserInfo() {
	var phoneNum = Common.queryGetParam("phoneNum");
    if(phoneNum ==null|| phoneNum=='' ||typeof(phoneNum) == "undefined"){
		phoneNum=localStorage.getItem("phoneNum");
	}
    if(phoneNum ==null|| phoneNum=='' ||typeof(phoneNum) == "undefined"){
        location.href = "http:/api.fenful.com/fenful/h5/recharge.html";
    }
	var paramStr = {};
	paramStr.phoneNum = phoneNum;
	var params = {};
	params.paramStr = JSON.stringify(paramStr);
	$.ajax({
		type: "post",
		url: "/fenful/api/v1/common/getUser",
		data: params,
		dataType: 'json',
		success: function(data) {
			if(data.code == "200") {
				var index = eval('(' + data.data + ')');
				console.log(index);
				$("#nickName").html(index.nickName);
				$("#money").html("￥"+index.money);
				$("#points").html("￥"+index.points);
			} else {
				console.log(data.message);
			}
		},
		error: function() {
			console.log('请求失败');
		}

	});

}